Ext.define('QMS.model.Project', {
	extend: 'Ext.data.TreeModel',
	fields: ['id', 'unit_id', 'name', 'description', 'text'],
	belongsTo: {
		name:'unit',
		type: 'belongsTo',
		model: 'QMS.model.Unit'
	},
	hasMany: {model: 'QMS.model.Employee', name: 'employees'},
	proxy: {
		type: 'ajax',
		url: 'project',
		reader: {
			type: 'json',
			root: 'root'
		},
        api: {
            create: 'project?do_action=create',
            read: 'project?do_action=read',
            update: 'project?do_action=update',
            destroy: 'project?do_action=destroy',
        },
	}
});
